/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package th.model;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author ubuntu
 */
@Entity
@Table(name = "mohon_maklumat_waris")
@NamedQueries({
    @NamedQuery(name = "PermohonanMaklumatWaris.findAll", query = "SELECT p FROM PermohonanMaklumatWaris p")})
public class PermohonanMaklumatWaris implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id_mohon_maklumat_waris")
    private Integer idMohonMaklumatWaris;
    
    @ManyToOne(fetch = FetchType.LAZY)
    
    @JoinColumn(name = "id_mohon_maklumat")
    private PermohonanMaklumat permohonan;
    
    @Column(name = "nama")
    private String nama;
    
    @Column(name = "no_akaun")
    private String noAkaun;
    
    @Column(name = "no_Kp")
    private String noKp;
    
    @Column(name = "alamat1")
    private String alamat1;
    
    @Column(name = "alamat2")
    private String alamat2;
    
    @Column(name = "alamat3")
    private String alamat3;
    
    @Column(name = "alamat4")
    private String alamat4;
    
    @Column(name = "poskod")
    private String poskod;
    
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "kod_negeri")
    private KodNegeri negeri;
    
    @Column(name = "no_tel1")
    private String noTel1;
    
    @Column(name = "no_tel2")
    private String noTel2;
    
    @Column(name = "no_tel3")
    private String noTel3;
    
    @ManyToOne()
    @JoinColumn(name = "kod_hubungan")
    private KodHubungan hubungan;
      
    @Embedded
    private InfoAudit infoAudit;

    public void setNoKp(String noKp) {
        this.noKp = noKp;
    }

    public String getNoKp() {
        return noKp;
    }
    
    public PermohonanMaklumatWaris() {
    }

    public PermohonanMaklumatWaris(Integer idMohonMaklumatWaris) {
        this.idMohonMaklumatWaris = idMohonMaklumatWaris;
    }

    public Integer getIdMohonMaklumatWaris() {
        return idMohonMaklumatWaris;
    }

    public void setIdMohonMaklumatWaris(Integer idMohonMaklumatWaris) {
        this.idMohonMaklumatWaris = idMohonMaklumatWaris;
    }

    public PermohonanMaklumat getPermohonan() {
        return permohonan;
    }

    public void setPermohonan(PermohonanMaklumat permohonan) {
        this.permohonan = permohonan;
    }

    public String getNama() {
        return nama;
    }

    public void setNama(String nama) {
        this.nama = nama;
    }
    
//    public String getNoKp() {
//        return noKp;
//    }
//
//    public void setNoKp(String noKp) {
//        this.noKp = noKp;
//    }

    public String getAlamat1() {
        return alamat1;
    }

    public void setAlamat1(String alamat1) {
        this.alamat1 = alamat1;
    }

    public String getAlamat2() {
        return alamat2;
    }

    public void setAlamat2(String alamat2) {
        this.alamat2 = alamat2;
    }

    public String getAlamat3() {
        return alamat3;
    }

    public void setAlamat3(String alamat3) {
        this.alamat3 = alamat3;
    }

    public String getAlamat4() {
        return alamat4;
    }

    public void setAlamat4(String alamat4) {
        this.alamat4 = alamat4;
    }

    public String getPoskod() {
        return poskod;
    }

    public void setPoskod(String poskod) {
        this.poskod = poskod;
    }

    public KodNegeri getNegeri() {
        return negeri;
    }

    public void setNegeri(KodNegeri negeri) {
        this.negeri = negeri;
    }

  
    public String getNoTel1() {
        return noTel1;
    }

    public void setNoTel1(String noTel1) {
        this.noTel1 = noTel1;
    }

    public String getNoTel2() {
        return noTel2;
    }

    public void setNoTel2(String noTel2) {
        this.noTel2 = noTel2;
    }

    public String getNoTel3() {
        return noTel3;
    }

    public void setNoTel3(String noTel3) {
        this.noTel3 = noTel3;
    }

    public KodHubungan getHubungan() {
        return hubungan;
    }

    public void setHubungan(KodHubungan hubungan) {
        this.hubungan = hubungan;
    }

    public InfoAudit getInfoAudit() {
        return infoAudit;
    }

    public void setInfoAudit(InfoAudit infoAudit) {
        this.infoAudit = infoAudit;
    }

    public String getNoAkaun() {
        return noAkaun;
    }

    public void setNoAkaun(String noAkaun) {
        this.noAkaun = noAkaun;
    }

    

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idMohonMaklumatWaris != null ? idMohonMaklumatWaris.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PermohonanMaklumatWaris)) {
            return false;
        }
        PermohonanMaklumatWaris other = (PermohonanMaklumatWaris) object;
        if ((this.idMohonMaklumatWaris == null && other.idMohonMaklumatWaris != null) || (this.idMohonMaklumatWaris != null && !this.idMohonMaklumatWaris.equals(other.idMohonMaklumatWaris))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "th.model.PermohonanMaklumatWaris[ idMohonMaklumatWaris=" + idMohonMaklumatWaris + " ]";
    }
    
}
